package com.example.cloud.model.business.medical;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by wangtao on 2018/7/2.
 */
@Entity(name = "treat_plan_home")
@Data
@EqualsAndHashCode(callSuper = false)
public class TreatPlanHome extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 患者主键
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 主诉ID
    @Column(name = "complaint_id")
    private Long complaintId;
    // 家庭病房主键(基础资料)
    @Column(name = "home_id")
    private Long homeId;
    // 病房名称
    @Column(name = "home_name")
    private String homeName;
    // 状态 1：激活 2：冻结
    @Column(name = "status", columnDefinition = "INT DEFAULT 1")
    private int status;
    // 冻结时间
    @Column(name = "freeze_time")
    private Date freezeTime;
    // 治疗周期
    @Column(name = "treat_cycle", columnDefinition = "INT DEFAULT 0")
    private int treatCycle;
    // 过期时间
    @Column(name = "expired_date")
    private Date expiredDate;
    // 单价
    @Column(name = "price")
    private BigDecimal price;
    // 数量
    @Column(name = "quantity")
    private int quantity;
    // 总价
    @Column(name = "total_price")
    private BigDecimal totalPrice;
    // 实付金额
    @Column(name = "actual_amount")
    private BigDecimal actualAmount;
    // 已划扣金额
    @Column(name = "deduct_amount")
    private BigDecimal deductAmount;
    // 是否续费
    @Column(name = "is_renewal", columnDefinition = "INT DEFAULT 0")
    private int isRenewal;
    // 续费折扣
    @Column(name = "discount")
    private Double discount;
    // 收费状态
    @Column(name = "charge_status", columnDefinition = "INT DEFAULT 0")
    private int chargeStatus;
    // 锁定标识
    @Column(name = "lock_flag",columnDefinition = "INT DEFAULT 0")
    private int lockFlag;
    // 基础、可选项目 [0]:基础 [1]:可选
    @Transient
    private List<List<TreatPlanHomeProject>> projects;
    // 基础、可选产品 [0]:基础 [1]:可选
    @Transient
    private List<List<TreatPlanHomeProduct>> products;
    // 折扣项目类型
    @Transient
    private List<TreatPlanHomeDiscountProject> discountProjects;
    // 折扣项目
    @Transient
    private List<TreatPlanHomeDiscountProjectDetails> discountProjectDetails;
    // 折扣产品类型
    @Transient
    private List<TreatPlanHomeDiscountProduct> discountProducts;
    // 折扣产品
    @Transient
    private List<TreatPlanHomeDiscountProductDetails> discountProductDetails;
}
